using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Facebook.Service;
using FriendsNearby.Services;
using System.Collections.Generic;
using System.Text;
using FriendsNearby.Services.Entities;
using System.Globalization;
using FriendsNearby.Properties;

namespace FriendsNearby.Fbml
{
    public partial class Default : System.Web.UI.Page
    {
        public const string MESSAGE = "message";

        protected void Page_Load(object sender, EventArgs e)
        {
            FriendsNearbySystem friendsNearbySystem = new FriendsNearbySystem();
            IUsersService userService = friendsNearbySystem.GetService<IUsersService>();

            userService.EnsureUserRegistryExists(fbApplication.UserID, fbApplication.Session.SessionKey);

            if (Context.Items.Contains(Default.MESSAGE))
            {
                statusMessage.SetMessage(Context.Items[Default.MESSAGE].ToString());
            }
        }
    }
}
